package css.gui;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;
import javax.swing.border.LineBorder;

import css.core.MainSimulation;
import css.core.SimObserver;
public class NewJFrame extends javax.swing.JFrame implements SimObserver{
	
	private MainSimulation sim=null;
    private boolean onSim=false;
    /**
     * Creates new form NewJFrame
     */
    public NewJFrame(String title) {
    	super(title);
    	try{
    	   initComponents();
    	}catch(Exception e){e.printStackTrace();}
    	//repaint();
    	this.setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        inputpanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        ratetext = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        timetext = new javax.swing.JTextField();
        portionpanel = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        prepacktext = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        foodtext = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        drinktext = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        fdbothtext = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        cashiernumtext = new javax.swing.JTextField();
        cooknumtext = new javax.swing.JTextField();
        baristasnumtext = new javax.swing.JTextField();
        cashiermintext = new javax.swing.JTextField();
        cookmintext = new javax.swing.JTextField();
        baristasmintext = new javax.swing.JTextField();
        cashiermaxtext = new javax.swing.JTextField();
        cookmaxtext = new javax.swing.JTextField();
        baristasmaxtext = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        queuelentext = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        simheadtext = new javax.swing.JLabel();
        startbu = new javax.swing.JButton();
        pausebu = new javax.swing.JButton();
        stopbu = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        intervaltext = new javax.swing.JTextField();
        logbu = new javax.swing.JButton();
        analysebu = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        eventbu = new javax.swing.JButton();
        recordpane = new javax.swing.JScrollPane();
        jPanel3 = new javax.swing.JPanel();
        queuep = new javax.swing.JPanel();
        customerp = new javax.swing.JPanel();
        cashierp = new javax.swing.JPanel();
        cookp = new javax.swing.JPanel();
        baristasp = new javax.swing.JPanel();
        timep = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        jLabel1.setText("Arrival rate");

 

        jLabel2.setText("Time limit");

  
        portionpanel.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel3.setText("Customer proportion");

        jLabel4.setText("pre-packed");

        jLabel5.setText("food only");

        jLabel6.setText("drink only");

        jLabel7.setText("food & drink");

        javax.swing.GroupLayout portionpanelLayout = new javax.swing.GroupLayout(portionpanel);
        portionpanel.setLayout(portionpanelLayout);
        portionpanel.setBorder(new LineBorder(Color.black,1));
        portionpanelLayout.setHorizontalGroup(
            portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(portionpanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel3)
                    .addGroup(portionpanelLayout.createSequentialGroup()
                        .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(foodtext, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
                            .addComponent(prepacktext)))
                    .addGroup(portionpanelLayout.createSequentialGroup()
                        .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(drinktext, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
                            .addComponent(fdbothtext))))
                .addContainerGap(41, Short.MAX_VALUE))
        );
        portionpanelLayout.setVerticalGroup(
            portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(portionpanelLayout.createSequentialGroup()
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(prepacktext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(foodtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(drinktext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(portionpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(fdbothtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 8, Short.MAX_VALUE))
        );

        jPanel1.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel8.setText("Staff  ");

        jLabel9.setText("cashier");

        jLabel10.setText("cook");

        jLabel11.setText("baristas");

   

        jLabel22.setText("Number");

        jLabel23.setText("Process min");

        jLabel24.setText(" &");

        jLabel25.setText("max time");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1.setBorder(new LineBorder(Color.black,1));
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cashiernumtext)
                    .addComponent(cooknumtext, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(baristasnumtext)
                    .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(cookmintext, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cashiermintext, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(baristasmintext)
                    .addComponent(jLabel23, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))
                .addGap(1, 1, 1)
                .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel25)
                    .addComponent(cookmaxtext, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cashiermaxtext, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(baristasmaxtext, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel22)
                    .addComponent(jLabel23)
                    .addComponent(jLabel24)
                    .addComponent(jLabel25))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cashiernumtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel9))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cashiermintext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(cashiermaxtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(cooknumtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cookmintext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cookmaxtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel11)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(baristasnumtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(baristasmintext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(baristasmaxtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jLabel12.setText("Max Queue Length");

        javax.swing.GroupLayout inputpanelLayout = new javax.swing.GroupLayout(inputpanel);
        inputpanel.setLayout(inputpanelLayout);
        inputpanelLayout.setHorizontalGroup(
            inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inputpanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(inputpanelLayout.createSequentialGroup()
                        .addGroup(inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(inputpanelLayout.createSequentialGroup()
                                .addGroup(inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(timetext, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)
                                    .addComponent(ratetext)))
                            .addGroup(inputpanelLayout.createSequentialGroup()
                                .addComponent(jLabel12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(queuelentext, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(portionpanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap())))
        );
        inputpanelLayout.setVerticalGroup(
            inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inputpanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ratetext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(timetext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(portionpanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(34, 34, 34)
                .addGroup(inputpanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(queuelentext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(39, Short.MAX_VALUE))
        );

        portionpanel.getAccessibleContext().setAccessibleName("");
        recordpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER );
        recordpane.setBackground(Color.white);
        simheadtext.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N
        simheadtext.setText("Simulation");

        startbu.setText("start");

        pausebu.setText("pause");

        stopbu.setText("stop");

        jLabel14.setText("Sample Interval");

        logbu.setText("Log into file");

        analysebu.setText("Analyse result");

        jLabel16.setBackground(new java.awt.Color(255, 255, 255));
        jLabel16.setText("Queue length");

        jLabel17.setText("Customers in waiting area");

        jLabel18.setText("Idle cashier");

        jLabel19.setText("Idle cook");

        jLabel20.setText("Idle baristas");

        jLabel21.setText("Time");

        eventbu.setText("View events");
     
 
        queuep.setBackground(Color.white);
        queuep.setLayout(new BoxLayout(queuep,BoxLayout.Y_AXIS));
        queueta=new JTextArea();
        queueta.setEditable(false);
        queueta.setPreferredSize(new Dimension(80,20));
    	queuep.add(queueta);
        
 
    	customerp.setBackground(Color.white);
        customerp.setLayout(new BoxLayout(customerp,BoxLayout.Y_AXIS));
        customerta=new JTextArea();
        customerta.setEditable(false);
    	customerta.setPreferredSize(new Dimension(170,20));
    	customerp.add(customerta);
        
    	cashierp.setBackground(Color.white);
        cashierp.setLayout(new BoxLayout(cashierp,BoxLayout.Y_AXIS));
        idlecashierta=new JTextArea();
        idlecashierta.setEditable(false);
    	idlecashierta.setPreferredSize(new Dimension(80,20));
    	cashierp.add(idlecashierta);
    	
    	cookp.setBackground(Color.white);
        cookp.setLayout(new BoxLayout(cookp,BoxLayout.Y_AXIS));
        idlecookta=new JTextArea();
        idlecookta.setEditable(false);
    	idlecookta.setPreferredSize(new Dimension(80,20));
    	cookp.add(idlecookta);
        
    	baristasp.setBackground(Color.white);
        baristasp.setLayout(new BoxLayout(baristasp,BoxLayout.Y_AXIS));
        idlebaristasta=new JTextArea();
        idlebaristasta.setEditable(false);
    	idlebaristasta.setPreferredSize(new Dimension(80,20));
    	baristasp.add(idlebaristasta);
        
        timep.setBackground(Color.white);
        timep.setLayout(new BoxLayout(timep,BoxLayout.Y_AXIS));
        timeta=new JTextArea();
        timeta.setEditable(false);
    	timeta.setPreferredSize(new Dimension(50,20));
    	timep.add(timeta);
        

        

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(queuep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(customerp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cashierp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cookp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(baristasp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(timep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 36, Short.MAX_VALUE))
        );
        jPanel3.setBackground(Color.white);
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(queuep, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(customerp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cashierp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cookp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(baristasp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(timep, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 58, Short.MAX_VALUE))
        );

        recordpane.setViewportView(jPanel3);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(recordpane, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addComponent(simheadtext, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(142, 142, 142)
                                        .addComponent(jLabel14)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(intervaltext, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addComponent(startbu)
                                        .addGap(18, 18, 18)
                                        .addComponent(pausebu, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(stopbu, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap(30, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(191, 191, 191)
                        .addComponent(eventbu, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(analysebu)
                        .addGap(18, 18, 18)
                        .addComponent(logbu, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(49, Short.MAX_VALUE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(intervaltext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel14)))
                    .addComponent(simheadtext, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(pausebu)
                    .addComponent(stopbu)
                    .addComponent(startbu))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jLabel17)
                    .addComponent(jLabel18)
                    .addComponent(jLabel19)
                    .addComponent(jLabel20)
                    .addComponent(jLabel21))
                .addGap(15, 15, 15)
                .addComponent(recordpane, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(analysebu)
                    .addComponent(logbu)
                    .addComponent(eventbu))
                .addContainerGap())
        );

        jLabel15.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N
        jLabel15.setText("Coffee Shop Simulator");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(inputpanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addGap(318, 318, 318)
                .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(4, 4, 4)
                .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(0, 18, Short.MAX_VALUE)
                        .addComponent(inputpanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        startbu.addActionListener(new bulistener());
        pausebu.addActionListener(new bulistener());
        stopbu.addActionListener(new bulistener());
        analysebu.addActionListener(new bulistener());
        eventbu.addActionListener(new bulistener());
        logbu.addActionListener(new bulistener());
        pack();
       
    }

   
    public void notifyupdate(int queuelen,int waiting,int idlecashier,int idlecook,int idlebaristas,String time){
    	  
        
        	queueta.append("     "+queuelen+"\n");
            customerta.append("     "+waiting+"\n");
        	
        	idlecashierta.append("     "+idlecashier+"\n");
            idlecookta.append("     "+idlecook+"\n");
            idlebaristasta.append("     "+idlebaristas+"\n");
            timeta.append("     "+time+"\n");
            JScrollBar bar=recordpane.getVerticalScrollBar();
            bar.setValue(bar.getMaximum());

        
    }
    
    public void notifyend(){
    	    onSim=false;
    	    simheadtext.setText("Simulation: Ended!");
    	    startbu.setText("start");
    }
    public void clearrecord(){
    	queueta.setText("");
    	customerta.setText("");
        idlecashierta.setText("");
        idlecookta.setText("");
        idlebaristasta.setText("");
        timeta.setText("");
    }
    
    public void observesim(MainSimulation sim){
    	sim.regObeserver(this);
    }
    public void showdata(){
    	JFrame dataf=new JFrame("Simulation Analysis");
    	dataf.setSize(500,300);
    	dataf.setBackground(Color.white);
    	JPanel p1=new JPanel();
    	p1.setPreferredSize(new Dimension(100,300));
    	JPanel p2=new JPanel();
    	p2.setPreferredSize(new Dimension(100,300));
    	JTextArea resultta=new JTextArea();
    	resultta.setPreferredSize(new Dimension(300,300));
    	dataf.getContentPane().add(p1,BorderLayout.WEST);
    	dataf.getContentPane().add(p2,BorderLayout.EAST);
    	dataf.getContentPane().add(resultta,BorderLayout.CENTER);
    	resultta.append("Simulation Statistics:\r\n\r\n");
    	resultta.append(sim.getData());
    	dataf.setVisible(true);
    }
    public void showEvents(){
    	JFrame dataf=new JFrame("Simulation Events");
    	dataf.setSize(500,300);
    	dataf.setBackground(Color.white);

    	JTextArea resultta=new JTextArea();
    	JScrollPane resultpane=new JScrollPane(resultta);
    	

    	dataf.getContentPane().add(resultpane,BorderLayout.CENTER);
    	resultta.append("Simulation Event Records:\r\n\r\n");
    	resultta.append(sim.getEvents());
    	dataf.setVisible(true);
    }
    
    private void simulationStart(ActionEvent ae){
    	if(onSim)return;
		try {
			sim = constructSimulatorFromInput();
		} catch (InputException e) {
			e.printStackTrace();
			JOptionPane.showMessageDialog(NewJFrame.this, e.toString());
			return;
		}
		Thread simthread=new Thread(sim);
		
		String interval=intervaltext.getText();
		if(interval.length()>0){
			try {
				try {
					sim.setSampleRate(Integer.parseInt(interval));
				} catch (NumberFormatException e) {
					e.printStackTrace();
					throw new InputException("Sample rate", InputException.FORMATTED_INCORRECT);
				}
			} catch (InputException e) {
				e.printStackTrace();
				JOptionPane.showMessageDialog(NewJFrame.this, e.toString());
				return;
			}
			
		}
		     
		observesim(sim);
		JButton bu=(JButton)ae.getSource();
		bu.setText("restart");
		onSim=true;
		clearrecord();
		simheadtext.setText("Simulation: Running!");
		simthread.start();
    }
    private void simulationStop(ActionEvent ae){
    	if(onSim){
			startbu.setText("start");
		    simheadtext.setText("Simulation: Stopped!");
		    if(sim==null)return;
		
		    sim.stop();
		    sim=null;
		    onSim=false;
		}
    }
    private void simulationPause(ActionEvent ae){
    	if(!onSim) return;
		if(sim==null) return;
		sim.pause();
		JButton bu=(JButton)ae.getSource();
		simheadtext.setText("Simulation: Paused!");
		bu.setText("resume");
    }
    private void simulationResume(ActionEvent ae){
    	if(!onSim) return;
		if(sim==null) return;
		sim.resume();
		JButton bu=(JButton)ae.getSource();
		simheadtext.setText("Simulation: Running!");
		bu.setText("pause");
    }
    private void simulationRestart(ActionEvent ae){
    	try {
			MainSimulation simulation = constructSimulatorFromInput();
			sim.stop();
			sim = simulation;
		} catch (InputException e) {
			e.printStackTrace();
			JOptionPane.showMessageDialog(NewJFrame.this, e.toString());
			return;
		}
		Thread simthread=new Thread(sim);
		
		String interval=intervaltext.getText();
		if(interval.length()>0){
			try {
				try {
					sim.setSampleRate(Integer.parseInt(interval));
				} catch (NumberFormatException e) {
					e.printStackTrace();
					throw new InputException("Sample rate", InputException.FORMATTED_INCORRECT);
				}
			} catch (InputException e) {
				e.printStackTrace();
				JOptionPane.showMessageDialog(NewJFrame.this, e.toString());
				return;
			}
		}
		observesim(sim);
		onSim=true;
		clearrecord();
		simheadtext.setText("Simulation: Running!");
		simthread.start();
    }
    private MainSimulation constructSimulatorFromInput() throws InputException{
    	if(ratetext.getText().isEmpty() ||
    			timetext.getText().isEmpty() ||
    			cashiernumtext.getText().isEmpty() ||
    			cooknumtext.getText().isEmpty() ||
    			baristasnumtext.getText().isEmpty() ||
    			cashiermintext.getText().isEmpty() ||
    			cashiermaxtext.getText().isEmpty() ||
    			cookmintext.getText().isEmpty() ||
    			cookmaxtext.getText().isEmpty() ||
    			baristasmintext.getText().isEmpty() ||
    			baristasmaxtext.getText().isEmpty() ||
    			queuelentext.getText().isEmpty() ||
    			prepacktext.getText().isEmpty() ||
    			foodtext.getText().isEmpty() ||
    			drinktext.getText().isEmpty() ||
    			fdbothtext.getText().isEmpty())
    		throw new InputException("", InputException.REQUIRED);
    	try {
    		double arrivalrate=Double.parseDouble(ratetext.getText());
    		if(arrivalrate <= 0)
    			throw new InputException("arrive rate", InputException.VALUE_INVALID);
    		int timelimit=Integer.parseInt(timetext.getText());
    		if(timelimit <= 0)
    			throw new InputException("timelimit", InputException.VALUE_INVALID);
    		int numcashier=Integer.parseInt(cashiernumtext.getText());
    		if(numcashier <= 0)
    			throw new InputException("number of cashier", InputException.VALUE_INVALID);
    		int numcook=Integer.parseInt(cooknumtext.getText());
    		if(numcook <= 0)
    			throw new InputException("number of cook", InputException.VALUE_INVALID);
    		int numbaristas=Integer.parseInt(baristasnumtext.getText());
    		if(numbaristas <= 0)
    			throw new InputException("number of baristas", InputException.VALUE_INVALID);
    		int mincashier=Integer.parseInt(cashiermintext.getText());
    		if(mincashier <= 0)
    			throw new InputException("cashier min process time", InputException.VALUE_INVALID);
    		int maxcashier=Integer.parseInt(cashiermaxtext.getText());
    		if(maxcashier <= 0)
    			throw new InputException("cashier max process time", InputException.VALUE_INVALID);
    		if(mincashier >= maxcashier)
    			throw new InputException("Cashier process time", InputException.VALUE_INVALID);
    		
    		int mincook=Integer.parseInt(cookmintext.getText());
    		if(mincook <= 0)
    			throw new InputException("cook min process time", InputException.VALUE_INVALID);
    		int maxcook=Integer.parseInt(cookmaxtext.getText());
    		if(maxcook <= 0)
    			throw new InputException("cook max process time", InputException.VALUE_INVALID);
    		if(mincook >= maxcook)
    			throw new InputException("Cashier process time", InputException.VALUE_INVALID);
    		
    		int minbaristas=Integer.parseInt(baristasmintext.getText());
    		if(minbaristas <= 0)
    			throw new InputException("baristas min process time", InputException.VALUE_INVALID);
    		int maxbaristas=Integer.parseInt(baristasmaxtext.getText());
    		if(maxbaristas <= 0)
    			throw new InputException("baristas max process time", InputException.VALUE_INVALID);
    		if(minbaristas >= maxbaristas)
    			throw new InputException("Cashier process time", InputException.VALUE_INVALID);
    		int maxqueuelen=Integer.parseInt(queuelentext.getText());
    		if(maxqueuelen <= 0)
    			throw new InputException("max queue length", InputException.VALUE_INVALID);
    		int prepackrate=Integer.parseInt(prepacktext.getText());
    		if(prepackrate <= 0)
    			throw new InputException("prepack rate", InputException.VALUE_INVALID);
    		int foodrate=Integer.parseInt(foodtext.getText());
    		if(foodrate <= 0)
    			throw new InputException("food rate", InputException.VALUE_INVALID);
    		int drinkrate=Integer.parseInt(drinktext.getText());
    		if(drinkrate <= 0)
    			throw new InputException("drink rate", InputException.VALUE_INVALID);
    		int fanddrate=Integer.parseInt(fdbothtext.getText());
    		if(fanddrate <= 0)
    			throw new InputException("food and drink rate", InputException.VALUE_INVALID);
    		return new MainSimulation(arrivalrate,timelimit,prepackrate,foodrate,drinkrate,fanddrate,numcashier,numcook,numbaristas,mincashier,maxcashier,mincook,maxcook,minbaristas,maxbaristas,maxqueuelen);
		} catch (NumberFormatException e) {
			e.printStackTrace();
			throw new InputException("", InputException.FORMATTED_INCORRECT);
		}
    	
    }
    //start and restart should check input, for each "parse", if there is exception, show errormessage to indicate that input is invalid
    class bulistener implements ActionListener{
    	public void actionPerformed(ActionEvent ae){
    		if(ae.getActionCommand().equals("start")){
    			simulationStart(ae);
    		}
    		else if(ae.getActionCommand().equals("restart")){
    			simulationRestart(ae);
    		}
    		else if(ae.getActionCommand().equals("pause")){
    			simulationPause(ae);
    		}
    		else if(ae.getActionCommand().equals("resume")){
    			simulationResume(ae);
    		}
    		else if(ae.getActionCommand().equals("stop")){
    			simulationStop(ae);
    		}
    		else if(ae.getActionCommand().equals("View events")){
    			if(onSim || sim == null)
            		return;
                showEvents();
    		}
            else if(ae.getActionCommand().equals("Analyse result")){
            	if(onSim || sim == null)
            		return;
                showdata();
    		}
            else if(ae.getActionCommand().equals("Log into file")){
            	if(onSim || sim == null)
            		return;
                sim.save();
    		}
    	}
    }


    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
         NewJFrame jf=new NewJFrame("Coffee Shop Simulator"); 
         jf.setVisible(true);
    }
    // Variables declaration - do not modify
    JLabel l;
    private javax.swing.JButton analysebu;
    private javax.swing.JTextField baristasmaxtext;
    private javax.swing.JTextField baristasmintext;
    private javax.swing.JTextField baristasnumtext;
    private javax.swing.JPanel baristasp;
    private javax.swing.JTextField cashiermaxtext;
    private javax.swing.JTextField cashiermintext;
    private javax.swing.JTextField cashiernumtext;
    private javax.swing.JPanel cashierp;
    private javax.swing.JTextField cookmaxtext;
    private javax.swing.JTextField cookmintext;
    private javax.swing.JTextField cooknumtext;
    private javax.swing.JPanel cookp;
    private javax.swing.JPanel customerp;
    private javax.swing.JTextField drinktext;
    private javax.swing.JButton eventbu;
    private javax.swing.JTextField fdbothtext;
    private javax.swing.JTextField foodtext;
    private javax.swing.JPanel inputpanel;
    private javax.swing.JTextField intervaltext;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel simheadtext;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JButton logbu;
    private javax.swing.JTextField prepacktext;
    private javax.swing.JButton pausebu;
    private javax.swing.JPanel portionpanel;
    private javax.swing.JTextField queuelentext;
    private javax.swing.JPanel queuep;
    private javax.swing.JTextField ratetext;
    private javax.swing.JScrollPane recordpane;
    private javax.swing.JButton startbu;
    private javax.swing.JButton stopbu;
    private javax.swing.JPanel timep;
    private javax.swing.JTextField timetext;
    private JTextArea queueta;
    private JTextArea customerta;
    private JTextArea idlecashierta;
    private JTextArea idlecookta;
    private JTextArea idlebaristasta;
    private JTextArea timeta;
    // End of variables declaration
}
